package com.ljw.hmall.controller;

import com.ljw.hmall.clients.ItemClient;
import com.ljw.hmall.dto.PageDTO;
import com.ljw.hmall.pojo.Item;
import com.ljw.hmall.pojo.PageResult;
import com.ljw.hmall.pojo.Params;
import com.ljw.hmall.service.SearchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/search")
@Slf4j
public class SearchController {

    @Autowired
    SearchService searchService;

    @PostMapping("/list")
    public PageResult searchByCondition(@RequestBody Params params){
      log.info("params:{}",params);
        PageResult pageResult=searchService.search(params);
            return pageResult;
    }
}
